<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>有 54 张牌，请模拟⽃地主发牌给三个⼈，底牌留三张</title>
</head>
<body>
    <script>
        var array=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,4,41,42,43,44,45,46,47,48,49,5,51,52,53,54]

      for (var i=0;i<array.length;i++) {
           var random = Math.floor(Math.random()*i)//生成一个随机数做欸数组的sandom
           var t = array[random]//交换当前发随机数
           array[random] = array[i]//生成随机random元素的值
           array[i] = t//交换
       }
       var p1=array.slice(0,17)
       var p2=array.slice(0,17)
       var p3=array.slice(0,17)
       var wan =array.slice(0,3)
       console.log('玩家1 ' +p1) 
       console.log('玩家2 ' +p2)
       console.log('玩家3 ' +p3)
       console.log('底牌'+wan)

    </script>
</body>
</html>